import { Observable, Subscriber } from 'rxjs'
import { exists, PathLike } from 'fs'
export function fileExist(path: PathLike): Observable<boolean> {
  return Observable.create((obser: Subscriber<boolean>) => {
    exists(path, (exist: boolean) => {
      obser.next(exist)
      obser.complete()
    })
  })
}
